1. Field of the Invention
The present invention relates to a technology for reading an image from a document pressed against a translucent plate with a platen and generating image data of the image.
2. Description of the Related Art
As one of representative image reading apparatuses that read an image from a document pressed against a translucent plate with a platen, there is a flatbed system document scanner that can read not only a sheet document but also a book document, and automatically detect a document size before completing a reading and scanning of the document. An infrared sensor is conventionally used to detect a document size in reading the document by the flatbed system. In recent years, to detect a document size in the main scanning direction, a line sensor (a charge-coupled device (CCD)) for reading a document image has come to be used instead of the infrared sensor. Detection of document sizes is necessary not only in the main scanning direction but also in a sub-scanning direction. To detect a document size in the sub-scanning direction, the whole surface of the document needs to be pre-scanned. When the whole surface of the document is pre-scanned, a delay occurs in reading the document. Therefore, in actual practice, the infrared sensor is used to detect a document size in the sub-scanning direction, like in the conventional practice, and the line sensor is used only to detect a document size in the main scanning direction.
Japanese Patent Application Laid-open No. H10-257255 describes a document size detecting apparatus that turns on an illumination lamp at the time of closing a document cover, reads a document image using a CCD sensor during a period from when the document cover is to be closed until when the document cover is brought into contact with the document, and that detects an edge of the document in the main scanning direction based on the read image data. Even when the document cover is to be closed, illumination light is reflected from a document area until when the document cover is substantially brought into contact with the document, and the CCD sensor can detect the document size under the light. However, the illumination light is not reflected to the CCD sensor in the area outside the document, and the CCD sensor detects this area as a dark area. A difference of this brightness appears in the edge of the document of the read image data.
Japanese Patent Application Laid-open No. 2000-138798 describes a document size detecting apparatus that drives an illumination lamp from a home position HP to a reading position when a document mat is opened, turns on the illumination lamp when the document mat is closed, thereby detecting a document size in the main scanning direction, and thereafter returns the illumination lamp to the home position. A reflection type optical sensor detects a size in the sub-scanning direction.
Japanese Patent Application Laid-open No. 2003-198809 describes a document size detecting apparatus that first turns on an illumination lamp in a state that a document platen is closed, reads data with a CCD line sensor by plural sampling areas in the main scanning direction, adds plural lines and determines presence of the document in the sampling areas, thereby obtaining a document size in the main scanning direction.
Japanese Patent Application Laid-open No. 2003-250028 describes an image forming apparatus that performs the following process. A first detector detects that a platen cover is being closed, and an exposure lamp is turned on. A scanner unit is moved in a sub-scanning direction, and an image sensor reads plural lines. A second detector detects completion of the platen cover. The exposure lamp is turned on again, and the scanner unit is moved in the opposite direction. The image sensor reads plural lines. The apparatus confirms a document size in the main scanning direction based on the total two sets of read information obtained by the scanning in forward and return directions. The apparatus detects a document size in a sub-scanning direction with a photo-sensor.
According to the system described in Japanese Patent Application Laid-open No. H10-257255, a document size in the main scanning direction is determined by assuming that the inside of the document is white and the outside of the document is black, when the platen is opened. When black is inside the document, a line sensor reading position is moved, and a document size is detected based on a white line within the document. The system described in Japanese Patent Application Laid-open No. 2000-138798 is the same as the system described in Japanese Patent Application Laid-open No. H10-257255 in that a document size in the main scanning direction is determined by assuming that the inside of the document is white and the outside of the document is black, when the platen is opened. However, data is obtained based on two conditions of when the lamp is turned on and when the lamp is turned off, and the influence of disturbance light is excluded. Both Japanese Patent Application Laid-open No. H10-257255 and Japanese Patent Application Laid-open No. 2000-138798 are effective in that precision of the detection of a document size is increased based on two or more kinds of read data. However, these two publications do not refer to a point of decreasing the time until when the platen is closed or the light does not excite user's eyes. The system described in Japanese Patent Application Laid-open No. 2003-198809 is the same as the system described in Japanese Patent Application Laid-open No. H10-257255 in that a document size in the main scanning direction is determined by assuming that the inside of the document is white and the outside of the document is black, when the platen is opened. However, a document size in the main scanning direction is detected using data read by the line sensor at plural points in the main scanning direction. According to the system described in Japanese Patent Application Laid-open No. 2003-198809, the time required until when the platen is closed is short. However, when the CCD line sensor reads the data, the light quantity of the lamp is in the middle of increasing, and the illumination light quantity can be unstable. Because the read data is simply averaged in the sub-scanning direction, the detection of a document size in the main scanning direction has a high risk of malfunctioning. The system described in Japanese Patent Application Laid-open No. 2003-250028 can have a problem similar to that of the system described in Japanese Patent Application Laid-open No. 2003-198809 at the first reading of data in the middle of closing the platen cover. At the second reading in the state that the platen cover is closed, the image on the document is read. Therefore, it is difficult to determine the size on the document. Furthermore, a size determining process based on the result of the first reading and the second reading can become complex.
While the user is closing the platen, when the document illumination lamp is turned on to detect a document size when the opening of the platen is large, the light of the lamp enters the user's eyes. Therefore, it is preferable to carry out the detection of the document size while the opening is as small as possible. However, when the detection is started while the opening is small, the platen is closed before the document size is successfully determined. This has a high possibility of a failure in determining the document size because the document cannot be discriminated from the white color of the surface below the platen. Consequently, it is necessary to turn on the lamp while the opening is small, and immediately detect the document size. However, the lamp to be used as the document illumination unit has a non-lighting time called a dark start when the lighting is started. It takes time for the light intensity to reach a predetermined value since the lamp is turned on. In general, the reading of a document is started after this dark start and the light intensity stabilization time passes. The dark start time has a large variation depending on environmental conditions such as brightness of the surrounding of the lamp and a temperature (a situation of an installation position), and a non-lighting period from the last lighting to the lighting this time. When the non-lighting period is long at a low-temperature and a dark position of small radiant ray like radiation, the dark start time is long. The dark start time is short at a high-temperature and a bright position of large radiant ray like radiation. For example, it takes about 300 ms as a maximum for the light intensity of a xenon lamp or a halogen lamp to be stabilized, and it requires a starting time of about 20 ms as a minimum for the light intensity to reach a level at which the document size can be detected.
Usually, by assuming a long dark start time, the lamp lighting is started when the platen has a relatively large opening. After a lapse of a setting time of the long dark start time since the lighting is started, the detection of the document size is started. As a result, in the environment of frequently reading the document at a short non-lighting interval in a warm and bright office, the document illumination light is quickly turned on at a relatively large opening when the platen is closed. Consequently, the lighting time of the document illumination lamp to detect the document size is long, and this has a high possibility of exciting the user's eyes. However, when the lighting starting timing of the document illumination lamp to detect the document size is delayed, the platen is substantially closed by the time when the light intensity of the document illumination lamp rises to a level suitable to detect the document size, immediately after the low-temperature and long non-lighting time. This has a high possibility of a failure in detecting the document size.